<template>
    <div class="mainDiv">
        <h1 v-text="message"></h1>
        <table class="t">
            <tbody>
                <tr>
                    <th>ID</th>
                    <th>NAME</th>
                    <th>LOGINNAME</th>
                    <th>CREATETIME</th>
                    <th>操作</th>
                </tr>
                <tr v-for="item in arr" :key="item">
                    <td>{{item.id}}</td>
                    <td>{{item.name}}</td>
                    <td>{{item.loginName}}</td>
                    <td>{{item.createTime}}</td>
                    <td><button @click=""></button></td>
                </tr>
            </tbody>
        </table>
        <router-link to="/adduser">[Form]</router-link>
    </div>
</template>

<script>
    import Axios from 'axios'
    export default {
        name: "Userlist",
        data() {
            return {
                message: 'UserList',
                a: 211,
                mycolor: 'green',
                arr: []
            }
        },
        created: function () {
            Axios.get('http://localhost/parkrun/userlist').then((res) =>{
                window.console.log(res.data);
                this.arr = res.data.data;
            })
        },
        methods: {
            checkxx: function (url) {
                window.open(url,"_blank");
            },
            toedit(){
                this.
            }
        }
    }
</script>

<style scoped>
    .hi{
        color: red;
        font-size: 20px;
    }
    li {
        list-style-type: none;
    }
    .mainDiv{
        margin:auto;
        text-align: center;
    }
    .t{
        margin:auto;
        border: 1px gray solid;
        border-spacing: 0px;
        border-collapse: collapse;
    }
   .t td{
       border: 1px gray solid;
    }
   .t th{
        border: 1px gray solid;
    }
</style>
